package com.pinc.cpbl;

import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import android.content.Context;

public class MyHTTPHelper {

	public static myHTMLparser ConnectURL(String urlstr, Context ctx)
	{
		try {
			//URL url = new URL("http://192.168.1.4/~pierre/cpbl.html");
			URL url = new URL(urlstr);
			HttpURLConnection conn = (HttpURLConnection) url.openConnection();
			conn.setConnectTimeout(8000);
			InputStream in = conn.getInputStream();
			myHTMLparser mp = new myHTMLparser(in, ctx);
			return mp;
		} catch (IOException e) {
			return null;
		}	
	}
}
